Im trying to make a discord account generator and using ouo.io to upload the accounts in,but everytime i try to gen,replit died.
<!DOCTYPE HTML>
^
SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at IncomingMessage.<anonymous> (/home/runner/AccountGenerator/node_modules/hastebin-save/src/upload.js:18:52)
at IncomingMessage.emit (events.js:326:22)
at IncomingMessage.EventEmitter.emit (domain.js:483:12)
at endReadableNT (_stream_readable.js:1241:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
repl process died unexpectedly: exit status 1
upload.js code:
const https = require('https');
const config = require('./../config.json')
module.exports = function(text, callbackFunction){
var req = https.request({
headers: {
"Content-Type": "application/json; charset=utf-8"
},
host: config.host,
port: config.port,
path: config.path,
method: "POST"
}, clb => {
var data = "";
clb.on('data', buffer => {
data += buffer;
});
clb.on("end", () => {callbackFunction(JSON.parse(data).key)});
});
req.write(text);
req.end();
}